package com.aeoj.clientmanagement.exception;

import com.aeoj.clientmanagement.enums.ResponseCodeEnum;
import lombok.Getter;

@Getter
public class BusinessException extends RuntimeException {

    /**
     * 错误码
     */
    private final int code;

    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(ResponseCodeEnum ResponseCodeEnum) {
        super(ResponseCodeEnum.getMessage());
        this.code = ResponseCodeEnum.getCode();
    }

    public BusinessException(ResponseCodeEnum ResponseCodeEnum, String message) {
        super(message);
        this.code = ResponseCodeEnum.getCode();
    }

}